﻿using Basic.UserRemoteModel.User;
using Basic.UserRemoteModel.User.Model;
using Shop.StoreGatewayModular.Interface;
using WeDonekRpc.Client;
using WeDonekRpc.HttpApiGateway.Model;

namespace Shop.StoreGatewayModular.Service
{
    internal class UserService : IUserService
    {
        public UserData Get (long id)
        {
            return new GetUser
            {
                Id = id
            }.Send();
        }
        public PagingResult<UserData> Query (PagingParam<UserQueryParam> param)
        {
            return new QueryUser
            {
                Index = param.Index,
                IsDesc = param.IsDesc,
                Size = param.Size,
                SortName = param.SortName,
                NextId = param.NextId,
                Query = param.Query
            }.Send();
        }

        public void Disable (long userId)
        {
            new DisableUser
            {
                Id = userId
            }.Send();
        }

        public void Enable (long userId)
        {
            new EnableUser
            {
                Id = userId
            }.Send();
        }
    }
}
